perf: compute volume OBV trend in one pass#21
Conversation
|
@ShauryaMallampati is attempting to deploy a commit to the dragoon4002's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Optimizes the obv_trend volume indicator by collapsing the previous two-pass OBV computation into a single pass, while preserving existing signal and detail-string behavior. Adds regression tests to ensure output parity with the prior implementation, including the "obv_prev zero" guard behavior.
Changes:
- Refactor
obv_trendto computeobv_prev(prefix) andobv_delta(tail) in one loop. - Keep existing guard/format behavior (
warming up…,"obv_prev zero", andOBV change%formatting). - Add tests that compare the new implementation against a two-pass reference and validate the zero-prefix case.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/strategies/quant_algos/volume_algos.py | Reworks OBV trend computation to a single-pass prefix/tail accumulation for better performance. |
| shared/tests/test_volume_algos.py | Adds regression coverage to ensure the refactor preserves prior results and edge-case behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Follow-up on checks: the visible Vercel status is blocked on repo-owner/team authorization, and the GitHub Actions workflows are waiting for maintainer approval to run on this forked PR. Local validation for this patch:
Copilot reviewed the current diff with no comments. |
|
Follow-up in Validation:
|
Refs #2.
Summary
Benchmark
Local synthetic OHLCV inputs, best of 5 repeats:
Validation